package com.wxmit.system.base.core;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wxmit.system.base.domain.PageDTO;

/**
 * @Description ServiceImpl
 * @Author huangxiong
 * @Date 2022/7/8 16:29
 * @Version V1.0
 */
public abstract class ShushanServiceImpl<M extends BaseMapper<T>,T> extends ServiceImpl<M,T> implements IShushanService<T> {

    @Override
    public IPage<T> listPage(PageDTO<T> pageDto) {
        LambdaQueryChainWrapper<T> lambdaQuery = lambdaQuery();
        processPageDTO(pageDto,lambdaQuery);
        return lambdaQuery.page(pageDto.getPage());
    }

    public LambdaQueryWrapper<T> getLambdaWrapper(){
        return new LambdaQueryWrapper<T>();
    }

    protected void processPageDTO(PageDTO<T> pageDTO,LambdaQueryChainWrapper<T> lambdaQuery){
        //DO NOTHING ...
    }

}
